local rolely_leihuo = fk.CreateSkill {
    name = "rolely_leihuo",
    anim_type = "defensive",
    tags = { Skill.Compulsory }
}
Fk:loadTranslationTable {
    ["rolely_leihuo"] = "雷祸",
    [":rolely_leihuo"] = "锁定技，当你使用非装备牌指定目标，或成为其他角色使用非装备牌的目标时，你可以进行一次判定，若判定牌与此牌花色相同，你获得判定牌和此牌；若判定结果为♠，你对一名角色造成一点雷电伤害，若为♣，你摸两张牌。",

    ["$rolely_leihuo1"] = "鬼道，才是你要遵循的命运！",
    ["$rolely_leihuo2"] = "跪伏在，鬼道的威力之下吧！",
}
local spec = {
    on_use = function(self, event, target, player, data)
        local room = player.room
        local judge = {
            who = player,
            reason = rolely_leihuo.name,
            pattern = ".|.|" .. data.card:getSuitString(),
        }
        room:judge(judge)
        if judge.card:getSuitString() == data.card:getSuitString() then
            room:obtainCard(player, data.card, true, fk.ReasonJustMove, player, rolely_leihuo.name)
            room:moveCardTo(judge.card, Card.PlayerHand, player, fk.ReasonJustMove, rolely_leihuo.name, nil, true, player)
        end
        if judge.card.suit == Card.Spade then
            local to = player.room:askToChoosePlayers(player,
                {
                    targets = player.room:getOtherPlayers(player),
                    min_num = 1,
                    max_num = 1,
                    skill_name = rolely_leihuo.name,
                    cancelable = true,
                    prompt =
                    "雷祸：请选择一名角色，对其造成一点雷电伤害"
                })[1]
            if to then
                room:damage({
                    from = player,
                    to = to,
                    damage = 1,
                    damageType = fk.ThunderDamage,
                    skillName = rolely_leihuo.name
                })
            end
        end
        if judge.card.suit == Card.Club then
            player:drawCards(2, rolely_leihuo.name)
        end
    end,
}
rolely_leihuo:addEffect(fk.TargetSpecifying, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(rolely_leihuo.name) and
            not data.to.dead and not player.dead and data.firstTarget and data.to ~= player and
            data.card.type ~= Card.TypeEquip
    end,
    on_use = spec.on_use,
})
rolely_leihuo:addEffect(fk.TargetConfirming, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(rolely_leihuo.name) and
            not data.from.dead and not player.dead and data.card.type ~= Card.TypeEquip
    end,
    on_use = spec.on_use,
})

return rolely_leihuo
